package com.daniu.eureka.client.api.user;


import com.daniu.eureka.client.api.user.dto.UserDTO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@RequestMapping("/feign-user")
@FeignClient("ServiceA")
public interface UserFeignService {


    @RequestMapping(value = "/", method = RequestMethod.POST)
    String createUser(@RequestBody UserDTO user);

    @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
    String updateUser(@PathVariable("id") Long id, @RequestBody UserDTO user);

    @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
    String deleteUser(@PathVariable("id") Long id);

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    UserDTO getById(@PathVariable("id") Long id);

}
